using System;
using OpenWaves.Web.Controls;

namespace OpenWaves.Navigation.Controls
{
    public class NavigationNodeContainer<T> : TreeNodeContainer<T>, INavigationNodeContainer
    {
        private readonly NavigationNodeState nodeState;
        public NavigationNodeState NodeState
        {
            get { return this.nodeState; }
        }

        [Obsolete("Use NodeStatus == NavigationNodeState.Expanded instead", true)]
        public bool IsNodeSelected
        {
            get { return this.NodeState == NavigationNodeState.Expanded; }
        }

        [Obsolete("Use NodeStatus == NavigationNodeState.Current instead", true)]
        public bool IsNodeCurrent
        {
            get { return this.NodeState == NavigationNodeState.Current; }
        }

        public NavigationNodeContainer(T node, int index, int level, NavigationNodeState nodeState, bool nodeHasVisibleChildren)
            : base(node, index, level, nodeHasVisibleChildren)
        {
            this.nodeState = nodeState;
        }
    }
}